package com.原型模式;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
/**
 * 子类：实现Cloneable接口
 */
public class Children implements Cloneable, Serializable {

    private String name;

    /**
     * 重写clone方法，并且把修饰符改成public的
     */
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
